/*
 * cmd_process.h
 *
 *  Created on: 2022/02/09
 *      Author: samuel
 */

#ifndef SRC_COMM_CMD_PROCESS_CMD_PROCESS_H_
#define SRC_COMM_CMD_PROCESS_CMD_PROCESS_H_

#include "A_aclass_protocol.h"
/* Public defines -----------------------------------------------------------*/
typedef struct {
    float slope;     // 斜率
    float intercept; // 截距
} SensorCalibration;

/* Public enum    -----------------------------------------------------------*/


/* Public Struct  -----------------------------------------------------------*/


/* Public Variable  ---------------------------------------------------------*/


/* Pubilc function prototypes -----------------------------------------------*/
ack_packet_t *Version_callback     ( user_packet_t * user );
ack_packet_t *Shakehand_callback   ( user_packet_t * user );
ack_packet_t *Selfcheck_callback   ( user_packet_t * user );
ack_packet_t *Cputem_callback      ( user_packet_t * user );
ack_packet_t *Workspace_callback   ( user_packet_t * user );
ack_packet_t *Deviceinf_callback   ( user_packet_t * user );
ack_packet_t *Serial_num_callback ( user_packet_t * user );
ack_packet_t *Savepara_callback    ( user_packet_t * user );
ack_packet_t *Reboot_callback      ( user_packet_t * user );
ack_packet_t *Check_time_callback  ( user_packet_t * user );
ack_packet_t *Read_Fram_callback  ( user_packet_t * user );

ack_packet_t *dhcp_switch_callback   ( user_packet_t * user );
ack_packet_t *local_ip_callback      ( user_packet_t * user );
ack_packet_t *local_port_callback    ( user_packet_t * user );
ack_packet_t *gateway_callback       ( user_packet_t * user );
ack_packet_t *netmark_callback       ( user_packet_t * user );
ack_packet_t *mac_callback           ( user_packet_t * user );
//ack_packet_t *can_baudrate_callback  ( user_packet_t * user );
//ack_packet_t *search_device_callback ( user_packet_t * user );
ack_packet_t *network_par_callback   ( user_packet_t * user );
ack_packet_t *update_par_callback    ( user_packet_t * user );

ack_packet_t *cail_tempAdc_callback(user_packet_t *user);
ack_packet_t *cail_presAdc_callback(user_packet_t *user);
ack_packet_t *cail_dac_callback(user_packet_t *user);
ack_packet_t *cail_preS1_callback(user_packet_t *user);
ack_packet_t *cail_preS2_callback(user_packet_t *user);
ack_packet_t *cail_preS3_callback(user_packet_t *user);
ack_packet_t *cail_preP0_callback(user_packet_t *user);
ack_packet_t *cail_preAmber_callback(user_packet_t *user);
ack_packet_t *cail_provalve_callback(user_packet_t *user);

ack_packet_t *ctrl_mode_callback(user_packet_t *user);
ack_packet_t *ctrl_process_callback(user_packet_t *user);
ack_packet_t *ctrl_devtime_callback(user_packet_t *user);
ack_packet_t *ctrl_readadc_callback(user_packet_t *user);
ack_packet_t *ctrl_setdac_callback(user_packet_t *user);
ack_packet_t *ctrl_cmd_callback(user_packet_t *user);
ack_packet_t *ctrl_motor_callback(user_packet_t *user);
ack_packet_t *ctrl_readmotor_callback(user_packet_t *user);
ack_packet_t *ctrl_backfill_callback(user_packet_t *user);
ack_packet_t *ctrl_led_seterror_callback(user_packet_t *user);
ack_packet_t *ctrl_led_restore_callback(user_packet_t *user);


ack_packet_t *pres_pumpSwitch_callback(user_packet_t *user);
ack_packet_t *pres_valveSwitch_callback(user_packet_t *user);
ack_packet_t *pres_setpres1_callback(user_packet_t *user);
ack_packet_t *pres_setpres2_callback(user_packet_t *user);
ack_packet_t *pres_setpres3_callback(user_packet_t *user);
ack_packet_t *pres_setpres4_callback(user_packet_t *user);
ack_packet_t *pres_setpres5_callback(user_packet_t *user);
ack_packet_t *pres_readpres1_callback(user_packet_t *user);
ack_packet_t *pres_readpres2_callback(user_packet_t *user);
ack_packet_t *pres_readpres3_callback(user_packet_t *user);
ack_packet_t *pres_readpres4_callback(user_packet_t *user);
ack_packet_t *pres_readpres5_callback(user_packet_t *user);
ack_packet_t *pres_state_callback(user_packet_t *user);
ack_packet_t *pres_setprovalve_callback(user_packet_t *user);

ack_packet_t *pres_tolerance1_callback(user_packet_t *user);
ack_packet_t *pres_tolerance2_callback(user_packet_t *user);
ack_packet_t *pres_tolerance3_callback(user_packet_t *user);
ack_packet_t *pres_tolerance4_callback(user_packet_t *user);
ack_packet_t *pres_tolerance5_callback(user_packet_t *user);

ack_packet_t *pres_pidcycle_callback(user_packet_t *user);
ack_packet_t *pres_pid_callback(user_packet_t *user);
ack_packet_t *pres_temp1_callback(user_packet_t *user);
ack_packet_t *pres_temp2_callback(user_packet_t *user);
ack_packet_t *pres_temp3_callback(user_packet_t *user);

ack_packet_t *pres_ctrl_callback(user_packet_t *user);
ack_packet_t *pres_gas_callback(user_packet_t *user);

ack_packet_t *valve_pulse_ctrl_callback(user_packet_t *user);
ack_packet_t *provalve_ctrl_callback(user_packet_t *user);
ack_packet_t *provalve_close_callback(user_packet_t *user);

ack_packet_t *cal_press_b_ctrl_callback(user_packet_t *user);
ack_packet_t *cal_press_match_b_ctrl_callback(user_packet_t *user);
ack_packet_t *cal_press_k_ctrl_callback(user_packet_t *user);
ack_packet_t *record_res_value_ctrl_callback(user_packet_t *user);

ack_packet_t *record_base_cbm_ctrl_callback(user_packet_t *user);
ack_packet_t *pres_valveSwitch_New_callback(user_packet_t *user);


ack_packet_t *ctrl_start_callback(user_packet_t *user);
ack_packet_t *pres_stop_infpum_callback(user_packet_t *user);

void read_all_sensors_calibration(void);
void read_tempsensors_calibration(void);
void InitHandshakeTimer(void);

#endif /* SRC_COMM_CMD_PROCESS_CMD_PROCESS_H_ */

/******************* (C) COPYRIGHT 2021 CIQTEK Samuel *****END OF FILE****/

